home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 10.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-11  |  7.5 KB  |  306 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11. parse arg Num Frames
  12. options results
  13. address "IMAGEFX.1"
  14. Quotes = '22'X
  15.     RequestResponse "Do You Need Instructions?"
  16.     if rc = 0 then do
  17.         call Docs()
  18.         end    
  19.  
  20.  
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40. end
  41. else do
  42.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IAType = RESULT.1+2
  50.            end
  51.  
  52.     call GetA()
  53. end
  54.  
  55. if FlyOn = 1 then
  56.     call CloseStuff()
  57.  
  58.  
  59.     ReDraw On
  60.     Gadget.1 = ' Select Background Type! '
  61.     Gadget.2 = ' Use Scroll Image '
  62.     Gadget.3 = ' Use Texture & Color '
  63.     Gadget.4 = ' Use Background Image '
  64.     ListRequest 4 Gadget
  65.     BackType = 0
  66.     if result = 2 then BackType = 0
  67.     if result = 3 then BackType = 1
  68.     if result = 4 then BackType = 2
  69.  
  70.  
  71.     if BackType = 0 then do
  72.         LoadBuffer "VFXIFX:Images/Pics/Seamless.Pic" Force
  73.         RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  74.         RequestFile '"Select File To Use For Background!" "VFXIFX:Images/Seamless" ""'
  75.         BrushName = result
  76.         Color = 1
  77.  
  78.         text1 = '"Move X"'
  79.         text2 = '"Move Y"'
  80.         Gadget.1  = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=1 LO=-10 HI=10 LV=%-3ld'
  81.         Gadget.2  = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
  82.         Gadget.3 = 'END'
  83.         NewComplexRequest  '"Select X & Y Movements!"' Gadget 250 42
  84.         if rc ~= 0 then do
  85.             XOff = 0
  86.             YOff = 0
  87.             end
  88.         else do
  89.             XOff = RESULT.1
  90.             YOff = RESULT.2
  91.             end
  92.         end
  93.  
  94.  
  95.     if BackType = 1 then do
  96.         LoadBuffer "VFXIFX:Images/Pics/Textures.Pic" Force
  97.         RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  98.         RequestFile '"Select File To Use For Background!" "VFXIFX:Images/Textures" ""'
  99.         BrushName = result
  100.         ActiveColor 2
  101.         RequestNotify "Click On Color To Use For Highlights Then Click "Quotes"Okay"Quotes""
  102.         ActiveColor
  103.         Color = result
  104.         ActiveColor 1
  105.         text1 = '"Move X"'
  106.         text2 = '"Move Y"'
  107.         Gadget.1  = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=1 LO=-10 HI=10 LV=%-3ld'
  108.         Gadget.2  = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
  109.         Gadget.3 = 'END'
  110.         NewComplexRequest  '"Select X & Y Movements!"' Gadget 250 42
  111.         if rc ~= 0 then do
  112.             XOff = 0
  113.             YOff = 0
  114.             end
  115.         else do
  116.             XOff = RESULT.1
  117.             YOff = RESULT.2
  118.             end
  119.  
  120.         end
  121.  
  122.     if BackType = 2 then do
  123.         LoadBuffer "VFXIFX:Images/Pics/Backdrops.Pic" Force
  124.         RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  125.         RequestFile '"Select File To Use For Background!" "VFXIFX:Images/Backdrops" ""'
  126.         BrushName = result
  127.         Color = 1
  128.         ActiveColor 1
  129.         end
  130.  
  131.  
  132.     Gadget.1 = ' Select Shape For Overlay! '
  133.     Gadget.2 = ' Rectangle '
  134.     Gadget.3 = ' Circle '
  135.     Gadget.4 = ' Oval '
  136.     Gadget.5 = ' Diamond '
  137.     ListRequest 5 Gadget
  138.     ShapeType = 0
  139.     if result = 2 then ShapeType = 0
  140.     if result = 3 then ShapeType = 1
  141.     if result = 4 then ShapeType = 2
  142.     if result = 5 then ShapeType = 3
  143.  
  144.  
  145.  
  146. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  147. call writeln TempFile,PicAName
  148. call writeln TempFile,Start
  149. call writeln TempFile,End
  150. call writeln TempFile,IAType
  151. call writeln TempFile,Color
  152. call writeln TempFile,BackType
  153. call writeln TempFile,XOff
  154. call writeln TempFile,YOff
  155. call writeln TempFile,BrushName
  156. call writeln TempFile,ShapeType
  157. call close TempFile
  158. exit
  159.  
  160.  
  161. GetFile:
  162.     parse Arg Title, Path
  163.     Address FLY_1 SetString Path
  164.     Address FLY_1 GetFileNameNT Title
  165. return result
  166.  
  167. GetFileName: procedure  
  168.    ARG CompleteName
  169.    c = lastpos("/",CompleteName)
  170.    if c = 0 then c = lastpos(":",CompleteName)
  171.    return substr(CompleteName, c + 1)
  172.  
  173.  
  174. GetA:
  175.  if IAType = 0 then do
  176.     call Switcher(TOSW)
  177.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  178.     Name = GetFileName(PicAName)
  179.     if Name = "" then do
  180.         Address FLY_1 OK_TEXT " OK "
  181.         Title = "You Must Enter A Valid Clip Name To Use!"
  182.         Address FLY_1 FYINT Title
  183.         Address FLY_1 Quit
  184.         call Switcher(TOWB)
  185.         exit
  186.         end
  187.     Address FLY_1 SetFileName PicAName
  188.     Address FLY_1 GetClipLength PicAName
  189.     End = result
  190.     Start = 0
  191.     Address FLY_1 Program "5"
  192.     Address FLY_1 StartNum Start
  193.     Address FLY_1 EndNum End
  194.     Address FLY_1 CurrentNum "0"
  195.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  196.     Start = word(result,1)*2
  197.     End = word(result,2)*2
  198.     Start  = Start + 1
  199.     End = End +2
  200.     call addlib('PROJECT_REXX_PORT' , 0)
  201.     call addlib(TOASTERLIB,0)
  202.     call Switcher(TOWB)
  203.     address command "C:Wait 1"
  204.     ScreenToFront
  205.     end
  206.    if IAType = 1 then do
  207.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  208.     PicAName = result
  209.     Name = GetFileName(PicAName)
  210.     if Name = "" then do
  211.         Title = "You Must Enter A Valid Name To Use!"
  212.         RequestNotify Title
  213.         if FlyOn = 1 then Address FLY_1 Quit
  214.         exit
  215.         end
  216.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  217.     End = result
  218.     Start = 1
  219.     end
  220.    if IAType = 2 then do
  221.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  222.     PicAName = result
  223.     Name = GetFileName(PicAName)
  224.     if Name = "" then do
  225.         Title = "You Must Enter A Valid Name To Use!"
  226.         RequestNotify Title
  227.         if FlyOn = 1 then Address FLY_1 Quit
  228.         exit
  229.         end
  230.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  231.     End = result
  232.     Start = 1
  233.     end
  234.    if IAType = 3 then do
  235.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  236.     PicAName = result
  237.     Name = GetFileName(PicAName)
  238.     if Name = "" then do
  239.         Title = "You Must Enter A Valid Name To Use!"
  240.         RequestNotify Title
  241.         if FlyOn = 1 then Address FLY_1 Quit
  242.         exit
  243.         end
  244.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  245.     End = result
  246.     Start = 1
  247.     end
  248. return
  249.  
  250. CloseStuff:
  251.     Address FLY_1 Quit
  252.     call remlib('ToasterARexx.port')
  253.     call remlib('PROJECT_REXX_PORT')
  254. return
  255.  
  256.  
  257. OpenFlyStuff:
  258.     FlyOn = 1
  259.     address command "run VFXIFX:FLY" 
  260.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  261.         address command "wait 1"
  262.         end
  263.     TOASTERLIB="ToasterARexx.port"
  264.     call remlib('ToasterARexx.port')
  265.     call remlib('PROJECT_REXX_PORT')
  266.     call addlib('PROJECT_REXX_PORT' , 0)
  267.     call addlib(TOASTERLIB,0)
  268.     DriveName = FindDrive()
  269. return
  270.  
  271.  
  272. FindDrive:
  273.     address command "C:Info >RAM:DriveList"
  274.     call open TempFile,"RAM:DriveList",R
  275.     do until eof(TempFile)
  276.         line = readln(TempFile)
  277.         parse var line Drive" "Rest
  278.         if Drive = "FA0:" then 
  279.             FlyVolume = word(Rest,7)":"
  280.     end
  281.     call close TempFile
  282.     address command "Delete >NIL: RAM:DriveList"
  283. return FlyVolume
  284.  
  285.  
  286.  
  287. Docs:
  288.  
  289.     text1 = '"This effect takes an image and places it on top of"'
  290.     text2 = '"a scrolling background or a single backdrop image."'
  291.     text3 = '"You can place the image in a rectangle, a circle,"'
  292.     text4 = '"an oval, or a diamond shape. The image will not be"'
  293.     text5 = '"scaled but simply placed inside the center area"'
  294.     text6 = '"allowing the edges to be cropped by the background."'
  295.  
  296.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  297.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  298.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  299.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  300.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  301.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  302.     Gadget.7 = 'END'
  303.     NewComplexRequest  '"Instructions For Effect #10"' Gadget 380 66
  304.  
  305. return
  306.